home *** CD-ROM | disk | FTP | other *** search
/ 3D GFX / 3D GFX.iso / amiutils / m_p / mpegintuition / mpegintuition.e < prev    next >
Text File  |  1995-12-30  |  39KB  |  1,036 lines

  1. /******************(E)(D)evelopment(S)ystem***************
  2. ** FileName:   mpegplayer_3.e
  3. ** Author:     Mahdi/Sauron
  4. ** Company:    GUILT
  5. ** Date:       10-01-95     Time:   18:24:20
  6. ** $VER:       2.2
  7. ***************************************⌐Sauron***********/
  8. /*********[Revision History]****[Last Update: 10-01-95]**/
  9. /*
  10. ** Version:   2.2
  11. ** Comment:   N/A
  12. **
  13. **     THAT IS TEST VERSION OF v2.2 !!!!!
  14. **
  15. **
  16. **   This Amiga E source is only an example of E programing.
  17. **   You can use part of it in your own programe (Place me on your thx.
  18. **   list :) but you CAN'T create any other Intuition by changing names
  19. **   only !!!!
  20. **
  21. **
  22. **
  23. */
  24.  
  25. OPT OSVERSION=37
  26.  
  27. MODULE 'gadtools', 'libraries/gadtools', 'intuition/intuition','intuition/gadgetclass',
  28.        'intuition/screens','wb',
  29.        'graphics/text','ReqTools','commodities','libraries/commodities',
  30.        'exec/types','exec/ports','exec/memory','dos/dos','devices/inputevent',
  31.        'libraries/ReqTools','exec/lists', 'exec/nodes', 'utility/tagitem',
  32.        'workbench/startup','workbench/workbench','icon'
  33.  
  34. /*-- Function return values. --*/
  35. ENUM NONE,NOCONTEXT, NOGADGET, NOWB, NOVISUAL, OPENGT, NOWINDOW,NO_MP,
  36.      NO_ICONLIB,NO_GADTOOLS,NO_REQTOOLS,NO_ICON
  37.  
  38. /*-- Gadget IDs. --*/
  39. ENUM DELETEBUTTON_ID, STRING_ID, LISTVIEW_ID,
  40.      INFOBUTTON_ID, PLAYBUTTON_ID ,LOADBUTTON_ID, LOADBUTTON2_ID
  41.  
  42. RAISE "MEM" IF New()=NIL,
  43.       "MEM" IF String()=NIL
  44.  
  45. CONST FILEREQ=0
  46.  
  47. DEF id_xsize[3]:     STRING,
  48.     id_ysize[3]:     STRING,
  49.     id_time[13]:     STRING,
  50.     id_framess[9]:   STRING,
  51.     id_framesb[9]:   STRING,
  52.     id_compress[7]:  STRING,
  53.     id_kb[4]:        STRING,
  54.     id_frames[4]:    STRING
  55.  
  56. /*-- Standard SrcGen stuff. --*/
  57. DEF win=NIL:PTR TO window,dither[20]:STRING,
  58.     scr=NIL:PTR TO screen,prr,x,y,
  59.     glist=NIL,dir[100]:STRING,buf[50]:STRING,
  60.     visual=NIL,count,gattext[100]:STRING,
  61.     infos:PTR TO gadget,prio,phii,
  62.     messageClass,rodzajDit,plik[100]:STRING,class,
  63.     offx, offy, tattr:PTR TO textattr ,mainfile[200]:STRING,mppath[100]:STRING,
  64.     appath[100]:STRING,noap=FALSE,shit=FALSE,wsize,poOOOOmitazmienna,
  65.     robot[200]:STRING,req:PTR TO rtfilerequester,f
  66.  
  67. /*-- Listview and supporting gadgets. --*/
  68. DEF list=NIL:PTR TO mlh,            /* Exec list holds listview items         */
  69.     listView=NIL:PTR TO gadget,     /* Listview gadget                        */
  70.     infoButton=NIL:PTR TO gadget,
  71.     loadButton=NIL:PTR TO gadget,
  72.     playButton=NIL:PTR TO gadget,
  73.     deleteButton=NIL:PTR TO gadget,
  74.     textX=NIL:PTR TO gadget,
  75.     textY=NIL:PTR TO gadget,
  76.     textSize=NIL:PTR TO gadget,
  77.     textKB=NIL:PTR TO gadget,
  78.     textComp=NIL:PTR TO gadget,
  79.     textFrames=NIL:PTR TO gadget,
  80.     textTime=NIL:PTR TO gadget,
  81.     textKlata=NIL:PTR TO gadget,
  82.     checkRAM=NIL:PTR TO gadget,
  83.     checkLoop=NIL:PTR TO gadget,
  84.     checkNOP=NIL:PTR TO gadget,
  85.     checkNOB=NIL:PTR TO gadget,
  86.     saveButton=NIL:PTR TO gadget, /* Button gadget TO delete an item        */
  87.     stringGadget=NIL:PTR TO gadget, /* String gadget, value added to listview */
  88.     stringGadgetValue:PTR TO CHAR,   /* Pointer to string gadget buffer        */   
  89.     check=FALSE,ch1=TRUE,ch2=TRUE,ch3=TRUE,ch4=TRUE,lue,player=1,font
  90.  
  91. PROC initList(l:PTR TO mlh)
  92. /*-- Initialize an exec list. --*/
  93.   l.head:=l+4
  94.   l.tail:=NIL
  95.   l.tailpred:=l
  96. ENDPROC
  97.  
  98. CHAR '$VER: MPEGInt. v2.2 by MAHDI/SAURON (c) 1995',0
  99.  
  100. PROC setupScreen()
  101. /*-- Open libraries and get screen info. --*/
  102.   IF (gadtoolsbase:=OpenLibrary('gadtools.library',37))=NIL THEN RETURN OPENGT
  103.   IF (scr:=LockPubScreen('Workbench'))=NIL THEN RETURN NOWB
  104.   IF (visual:=GetVisualInfoA(scr,NIL))=NIL THEN RETURN NOVISUAL
  105.   offy:=scr.wbortop+Int(scr.rastport+58)-10
  106.   IF font=0
  107.     tattr:=['topaz.font',8,0,0]:textattr
  108.   ELSE
  109.     tattr:=NIL
  110.   ENDIF
  111. ENDPROC  NONE
  112.  
  113. PROC closeScreen()
  114. /*-- Free resources, close screen and libraries. --*/
  115.   IF glist THEN FreeGadgets(glist)
  116.   IF visual THEN FreeVisualInfo(visual)
  117.   IF scr THEN UnlockPubScreen(NIL,scr)
  118.   IF gadtoolsbase THEN CloseLibrary(gadtoolsbase)
  119. ENDPROC
  120.  
  121. PROC createGadgets()
  122. /*-- Initialize gadget structures and create 'em. --*/
  123.   DEF g, stringInfo:PTR TO stringinfo
  124.   /*-- Init exec list to hold listview items.  Starts out empty. --*/
  125.   list:=New(SIZEOF mlh)
  126.   initList(list)
  127.   IF (g:=CreateContext({glist}))=NIL THEN RETURN NOCONTEXT
  128.   IF (g:=listView:=CreateGadgetA(LISTVIEW_KIND,g,
  129.     [offx+179,offy+26,130,104,'Dither type',tattr,LISTVIEW_ID,0,visual,0]:newgadget,
  130.     [GTLV_LABELS,list,
  131.      GTLV_SHOWSELECTED,NIL,
  132.      TAG_DONE]))=NIL THEN RETURN NOGADGET
  133.   IF (g:=textX:=CreateGadgetA(TEXT_KIND,g,
  134.     [offx+17,offy+31,32,12,'X',tattr,1,2,visual,0]:newgadget,
  135.     [GTTX_TEXT,'000',
  136.      GTTX_BORDER,1,
  137.      NIL]))=NIL THEN RETURN NOGADGET
  138.   IF (g:=textY:=CreateGadgetA(TEXT_KIND,g,
  139.     [offx+131,offy+31,32,12,'SIZE Y',tattr,2,1,visual,0]:newgadget,
  140.     [GTTX_TEXT,'000',
  141.      GTTX_BORDER,1,
  142.      NIL]))=NIL THEN RETURN NOGADGET
  143.   IF (g:=textTime:=CreateGadgetA(TEXT_KIND,g,
  144.     [offx+59,offy+46,104,12,'Time',tattr,3,1,visual,0]:newgadget,
  145.     [GTTX_TEXT,'00000.000000',
  146.      GTTX_BORDER,1,
  147.      NIL]))=NIL THEN RETURN NOGADGET
  148.   IF (g:=textFrames:=CreateGadgetA(TEXT_KIND,g,
  149.     [offx+83,offy+61,80,12,'Frame/s',tattr,4,1,visual,0]:newgadget,
  150.     [GTTX_TEXT,'00.000000',
  151.      GTTX_BORDER,1,
  152.      NIL]))=NIL THEN RETURN NOGADGET
  153.   IF (g:=textSize:=CreateGadgetA(TEXT_KIND,g,
  154.     [offx+83,offy+77,80,12,'Frame/B',tattr,5,1,visual,0]:newgadget,
  155.     [GTTX_TEXT,'000.00000',
  156.      GTTX_BORDER,1,
  157.      NIL]))=NIL THEN RETURN NOGADGET
  158.   IF (g:=textComp:=CreateGadgetA(TEXT_KIND,g,
  159.     [offx+98,offy+92,65,12,'Compress.',tattr,6,1,visual,0]:newgadget,
  160.     [GTTX_TEXT,'00:00.0',
  161.      GTTX_BORDER,1,
  162.      NIL]))=NIL THEN RETURN NOGADGET
  163.   IF (g:=textKB:=CreateGadgetA(TEXT_KIND,g,
  164.     [offx+42,offy+108,41,12,'KB',tattr,7,1,visual,0]:newgadget,
  165.     [GTTX_TEXT,'000000000',
  166.      GTTX_BORDER,1,
  167.      NIL]))=NIL THEN RETURN NOGADGET
  168.   IF (g:=textKlata:=CreateGadgetA(TEXT_KIND,g,
  169.     [offx+122,offy+108,41,12,'Fr.',tattr,7,1,visual,0]:newgadget,
  170.     [GTTX_TEXT,'0000',
  171.      GTTX_BORDER,1,
  172.      NIL]))=NIL THEN RETURN NOGADGET
  173.   IF ch1=0
  174.    IF (g:=checkRAM:=CreateGadgetA(CHECKBOX_KIND,g,
  175.      [offx+134,offy+132,26,11,'RAM',tattr,8,1,visual,0]:newgadget,
  176.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  177.   ELSE
  178.    IF (g:=checkRAM:=CreateGadgetA(CHECKBOX_KIND,g,
  179.      [offx+134,offy+132,26,11,'RAM',tattr,8,1,visual,0]:newgadget,
  180.      [NIL]))=NIL THEN RETURN NOGADGET
  181.   ENDIF
  182.   IF ch4=0
  183.    IF (g:=checkNOP:=CreateGadgetA(CHECKBOX_KIND,g,
  184.      [offx+167,offy+132,26,11,'NOP',tattr,9,2,visual,0]:newgadget,
  185.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  186.   ELSE
  187.    IF (g:=checkNOP:=CreateGadgetA(CHECKBOX_KIND,g,
  188.      [offx+167,offy+132,26,11,'NOP',tattr,9,2,visual,0]:newgadget,
  189.      [NIL]))=NIL THEN RETURN NOGADGET
  190.   ENDIF
  191.   IF ch2=0
  192.    IF (g:=checkLoop:=CreateGadgetA(CHECKBOX_KIND,g,
  193.      [offx+134,offy+147,26,11,'LOOP',tattr,10,1,visual,0]:newgadget,
  194.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  195.   ELSE
  196.    IF (g:=checkLoop:=CreateGadgetA(CHECKBOX_KIND,g,
  197.      [offx+134,offy+147,26,11,'LOOP',tattr,10,1,visual,0]:newgadget,
  198.      [NIL]))=NIL THEN RETURN NOGADGET
  199.   ENDIF
  200.   IF ch3=0
  201.    IF (g:=checkNOB:=CreateGadgetA(CHECKBOX_KIND,g,
  202.      [offx+167,offy+147,26,11,'NOB',tattr,11,2,visual,0]:newgadget,
  203.      [GTCB_CHECKED]))=NIL THEN RETURN NOGADGET
  204.   ELSE
  205.    IF (g:=checkNOB:=CreateGadgetA(CHECKBOX_KIND,g,
  206.      [offx+167,offy+147,26,11,'NOB',tattr,11,2,visual,0]:newgadget,
  207.      [NIL]))=NIL THEN RETURN NOGADGET
  208.   ENDIF
  209.   IF (g:=loadButton:=CreateGadgetA(BUTTON_KIND,g,
  210.     [offx+14,offy+178,20,14,'L',tattr,12,0,visual,0]:newgadget,
  211.     [NIL]))=NIL THEN RETURN NOGADGET
  212.   IF (g:=deleteButton:=CreateGadgetA(BUTTON_KIND,g,
  213.     [offx+284,offy+178,20,14,'D',tattr,12,0,visual,0]:newgadget,
  214.     [NIL]))=NIL THEN RETURN NOGADGET
  215.   IF (g:=stringGadget:=CreateGadgetA(STRING_KIND,g,
  216.     [offx+34,offy+179,250,12,'File ',tattr,13,4,visual,0]:newgadget,
  217.     [GTST_STRING,gattext,
  218.      GTST_MAXCHARS,256,
  219.      NIL]))=NIL THEN RETURN NOGADGET
  220.      stringInfo:=stringGadget.specialinfo
  221.      stringGadgetValue:=stringInfo.buffer
  222.   IF (g:=playButton:=CreateGadgetA(BUTTON_KIND,g,
  223.     [offx+15,offy+131,66,29,'PLAY',tattr,14,16,visual,0]:newgadget,
  224.     [NIL]))=NIL THEN RETURN NOGADGET
  225.   IF (g:=infoButton:=CreateGadgetA(BUTTON_KIND,g,
  226.     [offx+244,offy+131,58,14,'About',tattr,15,16,visual,0]:newgadget,
  227.     [NIL]))=NIL THEN RETURN NOGADGET
  228.   IF (g:=saveButton:=CreateGadgetA(BUTTON_KIND,g,
  229.     [offx+244,offy+147,58,13,'SAVE',tattr,16,16,visual,0]:newgadget,
  230.     [NIL]))=NIL THEN RETURN NOGADGET
  231. ENDPROC  NONE
  232.  
  233. PROC openWindow()
  234.   IF createGadgets()<>NONE THEN RETURN NOGADGET
  235.   /*-- Note WA_IDCMP to get messages from the listview gadget: --*/
  236.   IF (win:=OpenWindowTagList(NIL,
  237.     [WA_LEFT,         x,
  238.      WA_TOP,          y,
  239.      WA_WIDTH,        offx+316,
  240.      WA_HEIGHT,       offy+200,
  241.      WA_MINWIDTH, 316, WA_MINHEIGHT,  11,
  242.      WA_IDCMP,        (IDCMP_REFRESHWINDOW OR IDCMP_CLOSEWINDOW OR IDCMP_GADGETUP OR
  243.                        IDCMP_MOUSEMOVE OR LISTVIEWIDCMP OR SCROLLERIDCMP
  244. OR IDCMP_NEWSIZE),
  245.      WA_FLAGS,        (WFLG_DRAGBAR OR WFLG_DEPTHGADGET OR WFLG_CLOSEGADGET OR
  246.                        WFLG_SMART_REFRESH OR WFLG_ACTIVATE OR WFLG_HASZOOM),
  247.      WA_TITLE,'MPEG Intuition V2.2',
  248.      WA_SCREENTITLE,'MPEGIntuition v2.2 by Mahdi/Sauron',
  249.      WA_CUSTOMSCREEN, scr,
  250.      WA_AUTOADJUST,   1,
  251.      WA_GADGETS,      glist,
  252.      TAG_DONE]))=NIL THEN RETURN NOWINDOW
  253.   PrintIText(win.rport,
  254.     [1,0,0,50,14,tattr,'MPEG Info',NIL]:intuitext,offx,offy)
  255.   DrawBevelBoxA(win.rport,7+offx,165+offy,302,31,
  256.     [GT_VISUALINFO,visual,NIL])
  257.   DrawBevelBoxA(win.rport,7+offx,127+offy,302,37,
  258.     [GT_VISUALINFO,visual,NIL])
  259.   DrawBevelBoxA(win.rport,7+offx,26+offy,170,100,
  260.     [GT_VISUALINFO,visual,NIL])
  261.   Gt_RefreshWindow(win, NIL)
  262. ENDPROC NONE
  263.  
  264. PROC closeWindow()
  265.   IF win THEN CloseWindow(win)
  266. ENDPROC
  267.  
  268. PROC wait4message(win:PTR TO window)
  269.   DEF mes:PTR TO intuimessage,type
  270.   REPEAT
  271.     type:=0
  272.     IF mes:=Gt_GetIMsg(win.userport)
  273.       type:=mes.class
  274.       SELECT type
  275.         CASE IDCMP_NEWSIZE
  276. /*          IF wsize=1
  277.               ->wsize:=0
  278.  
  279.           ELSEIF wsize=0
  280.                wsize:=1
  281.           ENDIF*/
  282.         CASE IDCMP_GADGETUP
  283.           /*-- Any old gadget will do.  The address is used --*/
  284.           /*-- to identify which one sent the message.      --*/
  285.           infos:=mes.iaddress
  286.           infos.gadgetid:=mes.code
  287.         SELECT infos
  288.          CASE listView
  289.            rodzajDit:=mes.code
  290.          ENDSELECT
  291.           IF mes.code THEN check:=TRUE ELSE check:=FALSE
  292.          CASE IDCMP_REFRESHWINDOW
  293.           name()
  294.           IF wsize=1
  295.              IF poOOOOmitazmienna=1
  296. /*
  297. **               wpis()
  298. */
  299.                 Gt_SetGadgetAttrsA (textTime, win, NIL,
  300.                             [GTTX_TEXT,id_time,GTTX_BORDER,1,NIL])
  301.                 Gt_SetGadgetAttrsA (textX, win, NIL,
  302.                             [GTTX_TEXT,id_xsize,GTTX_BORDER,1,NIL])
  303.                 Gt_SetGadgetAttrsA (textY, win, NIL,
  304.                             [GTTX_TEXT,id_ysize,GTTX_BORDER,1,NIL])
  305.                 Gt_SetGadgetAttrsA (textSize, win, NIL,
  306.                             [GTTX_TEXT,id_framesb,GTTX_BORDER,1,NIL])
  307.                 Gt_SetGadgetAttrsA (textFrames, win, NIL,
  308.                             [GTTX_TEXT,id_framess,GTTX_BORDER,1,NIL])
  309.                 Gt_SetGadgetAttrsA (textComp, win, NIL,
  310.                             [GTTX_TEXT,id_compress,GTTX_BORDER,1,NIL])
  311.                 Gt_SetGadgetAttrsA (textKB,win ,NIL,
  312.                             [GTTX_TEXT,id_kb,GTTX_BORDER,1,NIL])
  313.                 Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  314.                             [GTTX_TEXT,id_frames,GTTX_BORDER,1,NIL])
  315.  
  316.                Gt_SetGadgetAttrsA (listView, win, NIL,
  317.                       [GTLV_LABELS, list,
  318.                        GTLV_TOP,    0,
  319.                        TAG_DONE])
  320.              ELSE
  321.               Gt_BeginRefresh(win)
  322.               Gt_EndRefresh(win,TRUE)
  323.              ENDIF
  324.                 PrintIText(win.rport,
  325.                 [1,0,0,50,14,tattr,'MPEG Info',NIL]:intuitext,offx,offy)
  326.                 DrawBevelBoxA(win.rport,7+offx,165+offy,302,31,
  327.                 [GT_VISUALINFO,visual,NIL])
  328.                 DrawBevelBoxA(win.rport,7+offx,127+offy,302,37,
  329.                 [GT_VISUALINFO,visual,NIL])
  330.                 DrawBevelBoxA(win.rport,7+offx,26+offy,170,100,
  331.                 [GT_VISUALINFO,visual,NIL])
  332.             wsize:=0
  333.           ELSEIF wsize=0
  334.               wsize:=1
  335.           ENDIF
  336.           type:=0
  337.       ENDSELECT
  338.       Gt_ReplyIMsg(mes)
  339.     ELSE
  340.       WaitPort(win.userport)
  341.     ENDIF
  342.   UNTIL type
  343. ENDPROC type
  344.  
  345. PROC addToList()
  346.   DEF newNode=NIL:PTR TO ln, node:PTR TO ln,
  347.       len, itemPosition=0
  348.   newNode:=New(SIZEOF ln)
  349.   len:=StrLen(lue)
  350.   newNode.name:=String(len)
  351.   StrCopy(newNode.name, lue, ALL)
  352. /*-- Detach the exec LIST from the listview gadget. --*/
  353.   Gt_SetGadgetAttrsA (listView, win, NIL, [GTLV_LABELS, -1, TAG_DONE])
  354. /*-- Decide where TO insert the new item.  Sorted on first character. --*/
  355.   node:=list.head
  356.   Insert(list, newNode, node.pred)
  357. /*  ENDIF*/
  358.   /*-- Reattach the exec list to the listview gadget. --*/
  359.   Gt_SetGadgetAttrsA (listView, win, NIL,
  360.                       [GTLV_LABELS, list,
  361.                        GTLV_TOP,    itemPosition,
  362.                        TAG_DONE])
  363. ENDPROC
  364.  
  365. PROC main() HANDLE
  366. DEF listItemPosition=0,mp_Task,pentla,brom
  367.   IF reqtoolsbase:=OpenLibrary('reqtools.library',37)
  368.    font:=1
  369.    ikona()
  370.    wsize:=0
  371.     IF FileLength(mppath)<=0
  372.       Raise(NO_MP)
  373.     ENDIF
  374.     pentla:=1
  375.     poOOOOmitazmienna:=0
  376.    IF setupScreen()=NONE
  377.     IF openWindow()=NONE
  378.      lue:='AMP-hiresham'
  379.      addToList()
  380.      lue:='AMP-ham6'
  381.      addToList()
  382.      lue:='AMP-color'
  383.      addToList()
  384.      lue:='Opal15'
  385.      addToList()
  386.      lue:='Opal24'
  387.      addToList()
  388.      lue:='Village24'
  389.      addToList()
  390.      lue:='EGS24'
  391.      addToList()
  392.      lue:='Retina24'
  393.      addToList()
  394.      lue:='Mono'
  395.      addToList()
  396.      lue:='FS4'
  397.      addToList()
  398.      lue:='FS2 Fast'
  399.      addToList()
  400.      lue:='FS2'
  401.      addToList()
  402.      lue:='Ordered2'
  403.      addToList()
  404.      lue:='Ordered'
  405.      addToList()
  406.      lue:='Hybrid2'
  407.      addToList()
  408.      lue:='Hybrid'
  409.      addToList()
  410.      lue:='Threshold'
  411.      addToList()
  412.      lue:='MBordered'
  413.      addToList()
  414.      lue:='2x2'
  415.      addToList()
  416.      lue:='Color'
  417.      addToList()
  418.      lue:='HAM6'
  419.      addToList()
  420.      lue:='HAM8'
  421.      addToList()
  422.      lue:='Gray'
  423.      addToList()
  424.      lue:='Gray8'
  425.      addToList()
  426.      rodzajDit:=prr
  427.     inform()
  428.       REPEAT
  429.         messageClass:=wait4message(win)
  430.         SELECT messageClass
  431.           CASE IDCMP_GADGETUP
  432.             SELECT infos  /* pointer to gadget */
  433.               CASE infoButton
  434.                inform()
  435.               CASE saveButton
  436.                IF req:=RtAllocRequestA(FILEREQ,0)
  437.                 phii:=RtLockWindow(win)
  438.                    RtEZRequestA('Prg. MP needs(?!?!?!??) path < 31 chars.',
  439.                    'BI-LA KAIFA !!!!',0,0,0)
  440.                    RtChangeReqAttrA(req,[RTFI_DIR,dir])
  441.                     IF RtFileRequestA(req,NIL,'Pick a drawer TO save !!!'
  442.                       ,[RTFI_FLAGS,(FREQF_NOFILES OR FREQF_SAVE)])
  443.                       StrCopy(robot,req.dir)
  444.                       StrCopy(plik,robot)
  445.                       StringF(robot,'IFF24.%%%%')
  446.                       IF RtGetStringA(robot,100,'Enter a file pattern !!!',0,0)
  447.                     StrCopy(mainfile,req.dir,ALL)
  448.                     IF StrCmp(req.dir[StrLen(mainfile)-1],':')
  449.                      StrCopy(plik,mainfile)
  450.                     ELSEIF StrCmp(req.dir[StrLen(mainfile)-1],'/')
  451.                      StrCopy(plik,mainfile)
  452.                     ELSEIF StrLen(mainfile)<1
  453.                      StrCopy(plik,mainfile)
  454.                     ELSE
  455.                      StrCopy(plik,mainfile)
  456.                      StrAdd(plik,'/')
  457.                     ENDIF
  458.                          StrCopy(mainfile,plik,ALL)
  459.                          StringF(plik,'"\s\s"',mainfile,robot)
  460.                            IF StrLen(plik)>31
  461.                              RtEZRequestA('It must be under 31 chars !!!!.',
  462.                              'Doup !!! Sorry I''ll try again !!',0,0,0)
  463.                            ELSE
  464.                          StringF(robot,'\s -saveiff \s "\s"',mppath,plik,gattext)
  465.                          Execute(robot,NIL,0)
  466.                          robot[]:=0
  467.                       ENDIF
  468.                     ENDIF
  469.                  ENDIF
  470.                  RtUnlockWindow(win,phii)
  471.                  RtFreeRequest(req)
  472.                ENDIF
  473.         CASE playButton
  474.             IF (noap=1) AND (rodzajDit>20)
  475.                shit:=1
  476.             ENDIF
  477.              IF shit=0
  478.               IF mp_Task:=Open('ram:pracfile',NEWFILE)
  479.                IF FileLength(stringGadgetValue)<>0
  480. /*
  481. ** Button OFF
  482. */
  483.            Gt_SetGadgetAttrsA (loadButton, win, NIL,
  484.                       [GA_DISABLED,1,TAG_DONE])
  485.            Gt_SetGadgetAttrsA (deleteButton, win, NIL,
  486.                       [GA_DISABLED,1,TAG_DONE])
  487.            Gt_SetGadgetAttrsA (playButton, win, NIL,
  488.                       [GA_DISABLED,1,TAG_DONE])
  489.            Gt_SetGadgetAttrsA (saveButton, win, NIL,
  490.                       [GA_DISABLED,1,TAG_DONE])
  491.            Gt_SetGadgetAttrsA (infoButton, win, NIL,
  492.                       [GA_DISABLED,1,TAG_DONE])
  493.  
  494.                 IF rodzajDit=0 THEN StrCopy(dither,' -dither gray8 ',ALL)
  495.                 IF rodzajDit=1 THEN StrCopy(dither,' -dither gray ',ALL)
  496.                 IF rodzajDit=2 THEN StrCopy(dither,' -dither ham8 ',ALL)
  497.                 IF rodzajDit=3 THEN StrCopy(dither,' -dither ham6 ',ALL)
  498.                 IF rodzajDit=4 THEN StrCopy(dither,' -dither color ',ALL)
  499.                 IF rodzajDit=5 THEN StrCopy(dither,' -dither 2x2 ',ALL)
  500.                 IF rodzajDit=6 THEN StrCopy(dither,' -dither mbordered ',ALL)
  501.                 IF rodzajDit=7 THEN StrCopy(dither,' -dither threshold ',ALL)
  502.                 IF rodzajDit=8 THEN StrCopy(dither,' -dither hybrid ',ALL)
  503.                 IF rodzajDit=9 THEN StrCopy(dither,' -dither hybrid2 ',ALL)
  504.                 IF rodzajDit=10 THEN StrCopy(dither,' -dither ordered ',ALL)
  505.                 IF rodzajDit=11 THEN StrCopy(dither,' -dither ordered2 ',ALL)
  506.                 IF rodzajDit=12 THEN StrCopy(dither,' -dither fs2 ',ALL)
  507.                 IF rodzajDit=13 THEN StrCopy(dither,' -dither fs2fast ',ALL)
  508.                 IF rodzajDit=14 THEN StrCopy(dither,' -dither fs4 ',ALL)
  509.                 IF rodzajDit=15 THEN StrCopy(dither,' -dither mono ',ALL)
  510.                 IF rodzajDit=16 THEN StrCopy(dither,' -dither retina24 ',ALL)
  511.                 IF rodzajDit=17 THEN StrCopy(dither,' -dither egs24 ',ALL)
  512.                 IF rodzajDit=18 THEN StrCopy(dither,' -dither village24 ',ALL)
  513.                 IF rodzajDit=19 THEN StrCopy(dither,' -dither opal24 ',ALL)
  514.                 IF rodzajDit=20 THEN StrCopy(dither,' -dither opal15 ',ALL)
  515.                 IF rodzajDit=21 THEN StrCopy(dither,' -dither color ',ALL)
  516.                 IF rodzajDit=22 THEN StrCopy(dither,' -dither ham6 ',ALL)
  517.                 IF rodzajDit=23 THEN StrCopy(dither,' -dither hiresham ',ALL)
  518.                 StringF(mainfile,'')
  519.                  IF rodzajDit>20
  520.                     StrAdd(mainfile,appath,ALL)
  521.                     player:=2
  522.                  ELSE
  523.                     StrAdd(mainfile,mppath,ALL)
  524.                     player:=1
  525.                  ENDIF
  526.                   IF ch3=0 THEN StrAdd(mainfile,' -nob',ALL)
  527.                   IF ch4=0 THEN StrAdd(mainfile,' -nob',ALL)
  528.                     StrAdd(mainfile,dither,ALL)
  529.                     count:=0
  530.                   IF ch2=0
  531.                         pentla:=1
  532.                         IF  RtGetLongA({pentla},'Write LOOP number:',0,0)
  533.                      ELSE
  534.                         pentla:=-1
  535.                      ENDIF
  536.                   ENDIF
  537.                IF pentla>0
  538.                  IF pentla=0 THEN pentla:=1
  539.                   IF ch1=0
  540.                     cop(stringGadgetValue,'ram:mpeg.tmp')
  541.                     StrAdd(mainfile,'RAM:')
  542.                     StrAdd(mainfile,'mpeg.tmp')
  543.                       count:=1
  544.                       REPEAT
  545.                         Execute(mainfile,0,mp_Task)
  546.                         count:=count+1
  547.                       UNTIL count>=pentla
  548.                     pentla:=1
  549.                      DeleteFile('ram:mpeg.tmp')
  550.                   ELSE
  551.                     StringF(robot,'"\s"',stringGadgetValue)
  552.                     StrAdd(mainfile,robot,ALL)
  553.                       REPEAT
  554.                         Execute(mainfile,0,mp_Task)
  555.                         count:=count+1
  556.                       UNTIL count=pentla
  557.                     pentla:=1
  558.                  ENDIF
  559.               ENDIF
  560.                    IF pentla=-1 THEN pentla:=1
  561. /*
  562. ** Button's OK
  563. */
  564.            poOOOOmitazmienna:=1
  565.            Gt_SetGadgetAttrsA (loadButton, win, NIL,
  566.                       [GA_DISABLED,0,TAG_DONE])
  567.            Gt_SetGadgetAttrsA (deleteButton, win, NIL,
  568.                       [GA_DISABLED,0,TAG_DONE])
  569.            Gt_SetGadgetAttrsA (playButton, win, NIL,
  570.                       [GA_DISABLED,0,TAG_DONE])
  571.            Gt_SetGadgetAttrsA (saveButton, win, NIL,
  572.                       [GA_DISABLED,0,TAG_DONE])
  573.            Gt_SetGadgetAttrsA (infoButton, win, NIL,
  574.                       [GA_DISABLED,0,TAG_DONE])
  575.              ENDIF
  576.               ENDIF
  577.                  Close(mp_Task)
  578.                  IF (FileLength('RAM:pracfile')>10) AND (FileLength
  579.                      ('RAM:pracfile')<175)
  580.                     wpis()
  581.                  ELSE
  582.                  ENDIF
  583.                 ENDIF
  584. /* ENDIF*/
  585.                shit:=0
  586.               CASE loadButton
  587.                IF req:=RtAllocRequestA(FILEREQ,0)
  588.                 phii:=RtLockWindow(win)
  589.                  RtChangeReqAttrA(req,[RTFI_DIR,dir,RTFI_MATCHPAT,
  590.                  '#?.(MPEG|MP|MPG)'])
  591.                   IF RtFileRequestA(req,buf,'Pick an mpeg anim !!!'
  592.                    ,[RT_WAITPOINTER,(512),RTFI_FLAGS,(FREQF_PATGAD),
  593.                    RTFI_OKTEXT,('SURE')])
  594.                    StrCopy(plik,buf)
  595.                    StrCopy(dir,req.dir)
  596.                     IF StrCmp(req.dir[StrLen(dir)-1],':')
  597.                      StrCopy(gattext,dir)
  598.                      StrAdd(gattext,plik)
  599.                     ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  600.                      StrCopy(gattext,dir)
  601.                      StrAdd(gattext,plik)
  602.                     ELSEIF StrLen(dir)<1
  603.                      StrCopy(gattext,dir)
  604.                      StrAdd(gattext,plik)
  605.                     ELSE
  606.                      StrCopy(gattext,dir)
  607.                      StrAdd(gattext,'/')
  608.                      StrAdd(gattext,plik)
  609.                     ENDIF
  610.                    Gt_SetGadgetAttrsA (stringGadget, win, NIL,
  611.                    [GTST_STRING,gattext,TAG_DONE])
  612.                    StrCopy(dir,req.dir)
  613.                    RtFreeRequest(req)
  614.                   ENDIF
  615.                  RtUnlockWindow(win,phii)
  616.                ENDIF
  617.               CASE listView
  618.                 listItemPosition:=infos.gadgetid /* note the use of this field! */
  619.               CASE checkRAM
  620.                 ch1:=check+1
  621.               CASE checkLoop
  622.                 ch2:=check+1
  623.               CASE checkNOP
  624.                 ch3:=check+1
  625.               CASE checkNOB
  626.                 ch4:=check+1
  627.               CASE deleteButton
  628.                phii:=RtLockWindow(win)
  629.                brom:=RtEZRequestA('Shall I delete that file ?\n\s',
  630.                'Delete|Nope leave it',0,[stringGadgetValue],0)
  631.               IF brom=1
  632.                  DeleteFile(stringGadgetValue)
  633.               ELSE
  634.               ENDIF
  635.               RtUnlockWindow(win,phii)
  636.            ENDSELECT
  637.           CASE IDCMP_INTUITICKS
  638.             NOP/*  these are being sent FOR some shitty reason }:-( */
  639.         ENDSELECT
  640.       UNTIL messageClass=IDCMP_CLOSEWINDOW
  641.       closeWindow()
  642.        IF FileLength('ram:pracfile')>0
  643.           DeleteFile('ram:pracfile')
  644.        ENDIF
  645.     ENDIF
  646.   ENDIF
  647.   CloseLibrary(reqtoolsbase)
  648.  ELSE
  649.   Raise(NO_REQTOOLS)
  650.  ENDIF
  651.   closeScreen()
  652.   CleanUp(0)
  653. EXCEPT
  654.   SELECT exception
  655.       IF reqtoolsbase THEN CloseLibrary(reqtoolsbase)
  656.       CASE NO_MP
  657.                          EasyRequestArgs(NIL,
  658.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  659.                         '   I can''t find MP program   \n   check path in icon prefs',
  660.                         'OK :(']:easystruct,
  661.                         NIL,NIL)
  662.       CASE NO_ICONLIB
  663.                         EasyRequestArgs(NIL,
  664.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  665.                         '   Sorry no icon.library\nin your''s LIBS: dir',
  666.                         'OK I''ll copy it']:easystruct,
  667.                         NIL,NIL)
  668.       CASE NO_ICON
  669.                         EasyRequestArgs(NIL,
  670.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  671.                         'Sorry, you need TO run\n this program from WB',
  672.                         'OK (I understand)']:easystruct,
  673.                         NIL,NIL)
  674.       CASE NO_REQTOOLS
  675.                         EasyRequestArgs(NIL,
  676.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  677.                         ' Sorry no ReqTools.library\n   in your''s LIBS: dir',
  678.                         'OK I''ll copy it']:easystruct,
  679.                         NIL,NIL)
  680.       DEFAULT
  681.       WriteF('Well there is some error ( >:-< ) blΓΓΓΓdddd np.\n')
  682.       WriteF('Excident nr: "\s"\n', [exception, 0])
  683.       closeWindow()
  684.       closeScreen()
  685.       CleanUp(0)
  686.   ENDSELECT
  687. ENDPROC
  688.  
  689. PROC name()
  690.   SetWindowTitles(win,'MPEG Intuition V2.2', Not(0))
  691. ENDPROC
  692.  
  693. PROC inform()
  694.  
  695. DEF w=NIL:PTR TO window
  696.     phii:=RtLockWindow(win)
  697.  IF w:=OpenWindowTagList(NIL,[WA_FLAGS,$E,WA_IDCMP,$268,
  698.                   WA_TOP,win.topedge+40,WA_LEFT,win.leftedge+8,
  699.                   WA_WIDTH,300,WA_HEIGHT,140,WA_TITLE,'About MPEG intuition V2.2',0])
  700.                   SetStdRast(w.rport)
  701.                   SetTopaz(8)
  702.                   Colour(2,0)
  703.                   TextF(55,30,'  MPEG Intuition v2.2')
  704.                   TextF(52,45,'by Mahdi/Sauron (c) 1995')
  705.                   Colour(1,0)
  706.                   TextF(55,65,'Bugs & Develope send TO:')
  707.                   TextF(45,75,'Adrian (SAURON) Siemieniak')
  708.                   TextF(45,85,'sauron@sco.zsi.pwr.wroc.pl')
  709.                   TextF(35,95,'sauron@sun1000.ci.pwr.wroc.pl')
  710.                   TextF(75,105,'tel.(071) 24-10-20')
  711.                   TextF(10,125,'-----------------------------------')
  712.                   WHILE (class:=WaitIMessage(w))<>IDCMP_CLOSEWINDOW
  713.                   ENDWHILE
  714.                    CloseWindow(w)
  715.                   name()
  716.  ENDIF
  717.     RtUnlockWindow(win,phii)
  718. ENDPROC
  719.  
  720. PROC wpis()
  721.   DEF inputstring[80]:STRING,work[20]:STRING,work2[14]:STRING,mp_Task,x,y,a,b
  722.   IF FileLength('ram:pracfile')>0
  723.    IF mp_Task:=Open('ram:pracfile',OLDFILE)
  724.       ReadStr(mp_Task,inputstring)
  725.       StrCopy(work2,'')
  726.     IF player=1
  727.       ReadStr(mp_Task,inputstring)
  728.       MidStr(work,inputstring,41,StrLen(inputstring)-46)
  729.       FOR a:=0 TO 12-StrLen(work) DO StrAdd(work2,' ')
  730.       x:= RealVal(work)
  731.       StrAdd(work2,work)
  732.       StrCopy(id_time,work2)
  733.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  734.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  735.  
  736.       ReadStr(mp_Task,inputstring)
  737.       a:= InStr(inputstring,' x',10)
  738.       MidStr(work,inputstring,11,a-11)
  739.       StrCopy(id_xsize,work)
  740.       Gt_SetGadgetAttrsA (textX, win, NIL,
  741.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  742.       a:= InStr(inputstring,'x ',10)
  743.       b:= InStr(inputstring,' Pi',10)
  744.       b:= b-2-a
  745.       IF b=2
  746.           a:=a-1
  747.           b:=3
  748.       ENDIF
  749.       MidStr(work,inputstring,a+2,b)
  750.       StrCopy(id_ysize,work)
  751.       Gt_SetGadgetAttrsA (textY, win, NIL,
  752.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  753.  
  754.       ReadStr(mp_Task,inputstring)
  755.       StrCopy(work2,'')
  756.       MidStr(work,inputstring,17,StrLen(inputstring)-6)
  757.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  758.       y:= RealVal(work)
  759.       StrAdd(work2,work)
  760.       StrCopy(id_framess,work2)
  761.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  762.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  763.  
  764.       ReadStr(mp_Task,inputstring)
  765.       UpperStr(inputstring)
  766.       StrCopy(work2,'')
  767.       a:= InStr(inputstring,' BYTES',13)
  768.       MidStr(work,inputstring,16,a-16)
  769.       FOR a:=1 TO 9- StrLen(work) DO StrAdd(work2,' ')
  770.       StrAdd(work2,work)
  771.       StrCopy(id_framesb,work2)
  772.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  773.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  774.       a:= InStr(inputstring,'TE ',42)
  775.       MidStr(work,inputstring,a+2,7)
  776.       StrCopy(id_compress,work)
  777.       Gt_SetGadgetAttrsA (textComp, win, NIL,
  778.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  779.     ELSE
  780.       ReadStr(mp_Task,inputstring)
  781.       MidStr(work,inputstring,41,StrLen(inputstring)-46)
  782.       FOR a:=0 TO 12-StrLen(work) DO StrAdd(work2,' ')
  783.       x:= RealVal(work)
  784.       StrAdd(work2,work)
  785.       StrCopy(id_time,work2)
  786.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  787.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  788.  
  789.       ReadStr(mp_Task,inputstring)
  790.       StrCopy(work2,'')
  791.       MidStr(work,inputstring,17,StrLen(inputstring)-6)
  792.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  793.       y:= RealVal(work)
  794.       StrAdd(work2,work)
  795.       StrCopy(id_framess,work2)
  796.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  797.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  798.  
  799.       ReadStr(mp_Task,inputstring)
  800.       a:= InStr(inputstring,'*',10)
  801.       MidStr(work,inputstring,12,a-12)
  802.       StrCopy(id_xsize,work)
  803.       Gt_SetGadgetAttrsA (textX, win, NIL,
  804.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  805.       a:= InStr(inputstring,'*',10)
  806.       b:= InStr(inputstring,' pi',10)
  807.       b:= b-2-a
  808.       IF b=1
  809.           b:=2
  810.           MidStr(work2,inputstring,a+1,b)
  811.           StringF(work,' \s',work2)
  812.       ELSEIF
  813.           MidStr(work,inputstring,a+1,b+2)
  814.       ENDIF
  815.       StrCopy(id_ysize,work)
  816.       Gt_SetGadgetAttrsA (textY, win, NIL,
  817.                   [GTTX_TEXT,work,GTTX_BORDER,1,NIL])
  818.  
  819.       StrCopy(work2,'')
  820.       b:= !x*y
  821.       a:= FileLength(gattext)/(!b!)
  822.       StringF(work,'\d.2',a)
  823.       FOR a:=0 TO 8-StrLen(work) DO StrAdd(work2,' ')
  824.       StrAdd(work2,work)
  825.       StrCopy(id_framesb,work2)
  826.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  827.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  828.  
  829.    ENDIF
  830.  
  831. /* File length procedure*/
  832.       StrCopy(work2,'')
  833.       StringF(work,'\d',FileLength(gattext))
  834.       a:= Val(work)
  835.       b:=Div(a,1024)
  836.       StringF(work,'\d',b)
  837.       FOR a:=0 TO 3-StrLen(work) DO StrAdd(work2,' ')
  838.       StrAdd(work2,work)
  839.       StrCopy(id_kb,work2)
  840.       Gt_SetGadgetAttrsA (textKB,win ,NIL,
  841.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  842.  
  843. /* Frames counter procedure */
  844.       b:=!x*y
  845.       StringF(work,'\d',!b!)
  846.       StrCopy(work2,'')
  847.       FOR a:=0 TO 3-StrLen(work) DO StrAdd(work2,' ')
  848.       StrAdd(work2,work)
  849.       StrCopy(id_frames,work2)
  850.       Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  851.                   [GTTX_TEXT,work2,GTTX_BORDER,1,NIL])
  852.     Close(mp_Task)
  853.   ENDIF
  854.  ELSE
  855.       Gt_SetGadgetAttrsA (textTime, win, NIL,
  856.                   [GTTX_TEXT,id_time,GTTX_BORDER,1,NIL])
  857.       Gt_SetGadgetAttrsA (textX, win, NIL,
  858.                   [GTTX_TEXT,id_xsize,GTTX_BORDER,1,NIL])
  859.       Gt_SetGadgetAttrsA (textY, win, NIL,
  860.                   [GTTX_TEXT,id_ysize,GTTX_BORDER,1,NIL])
  861.       Gt_SetGadgetAttrsA (textSize, win, NIL,
  862.                   [GTTX_TEXT,id_framesb,GTTX_BORDER,1,NIL])
  863.       Gt_SetGadgetAttrsA (textFrames, win, NIL,
  864.                   [GTTX_TEXT,id_framess,GTTX_BORDER,1,NIL])
  865.       Gt_SetGadgetAttrsA (textComp, win, NIL,
  866.                   [GTTX_TEXT,id_compress,GTTX_BORDER,1,NIL])
  867.       Gt_SetGadgetAttrsA (textKB,win ,NIL,
  868.                   [GTTX_TEXT,id_kb,GTTX_BORDER,1,NIL])
  869.       Gt_SetGadgetAttrsA (textKlata,win ,NIL,
  870.                   [GTTX_TEXT,id_frames,GTTX_BORDER,1,NIL])
  871.  ENDIF
  872. ENDPROC
  873.  
  874. PROC ikona()
  875.         DEF wb:PTR TO wbstartup,wba:PTR TO wbarg,dobj:PTR TO diskobject,toolarray,
  876.         str,olddir=0,pri=0,read=0
  877.         IF (iconbase:=OpenLibrary('icon.library',37))
  878.         ELSE
  879.             Raise(NO_ICONLIB)
  880.         ENDIF
  881.    IF wbmessage
  882.                 wb:=wbmessage ; wba:=wb.arglist
  883.                 IF (wba.lock>0) AND (wba.name>0)
  884.                         olddir:=CurrentDir(wba.lock)
  885.                 ENDIF
  886.                  IF (dobj:=GetDiskObject(wba.name))>0
  887.                     toolarray:=dobj.tooltypes
  888.                        IF (str:=FindToolType(toolarray,'MP_PATH'))>0
  889.                          StrCopy(mppath,str,ALL)
  890.                        ENDIF
  891.                        IF (str:=FindToolType(toolarray,'AP_PATH'))>0
  892.                          StrCopy(appath,str,ALL)
  893.                          IF FileLength(appath)<=0
  894.                              noap:=1
  895.                          EasyRequestArgs(NIL,
  896.                         [SIZEOF easystruct, 0, 'MPEGInt. Request Window',
  897.                         '   I can''t find Amipeg program   \n     check path in icon prefs',
  898.                         'OK :(']:easystruct,
  899.                         NIL,NIL)
  900.                          ENDIF
  901.                        ENDIF
  902.                        IF (str:=FindToolType(toolarray,'MP_PRIO'))>0
  903.                          pri:=Val(str,read)
  904.                           IF read=0
  905.                            prio:=pri
  906.                           ENDIF
  907.                        ENDIF
  908.                        IF (str:=FindToolType(toolarray,'MP_ANIMPATH'))>0
  909.                          StrCopy(dir,str,ALL)
  910.                        ENDIF
  911.                        IF (str:=FindToolType(toolarray,'MP_ANIMNAME'))>0
  912.                         IF StrCmp(req.dir[StrLen(dir)-1],':')
  913.                          StrCopy(gattext,dir)
  914.                          StrAdd(gattext,str)
  915.                         ELSEIF StrCmp(req.dir[StrLen(dir)-1],'/')
  916.                          StrCopy(gattext,dir)
  917.                          StrAdd(gattext,str)
  918.                         ELSEIF StrLen(dir)<1
  919.                          StrCopy(gattext,dir)
  920.                          StrAdd(gattext,str)
  921.                         ELSE
  922.                          StrCopy(gattext,dir)
  923.                          StrAdd(gattext,'/')
  924.                          StrAdd(gattext,str)
  925.                         ENDIF
  926.                        ENDIF
  927.                        IF (str:=FindToolType(toolarray,'MP_DITHER'))>0
  928.                          IF StrCmp(UpperStr(str),'GRAY8')
  929.                              prr:=0
  930.                          ELSEIF StrCmp(UpperStr(str),'GRAY')
  931.                              prr:=1
  932.                          ELSEIF StrCmp(UpperStr(str),'HAM8')
  933.                              prr:=2
  934.                          ELSEIF StrCmp(UpperStr(str),'HAM6')
  935.                              prr:=3
  936.                          ELSEIF StrCmp(UpperStr(str),'COLOR')
  937.                              prr:=4
  938.                          ELSEIF StrCmp(UpperStr(str),'2X2')
  939.                              prr:=5
  940.                          ELSEIF StrCmp(UpperStr(str),'MBORDERED')
  941.                              prr:=6
  942.                          ELSEIF StrCmp(UpperStr(str),'TRESHOLD')
  943.                              prr:=7
  944.                          ELSEIF StrCmp(UpperStr(str),'HYBRID')
  945.                              prr:=8
  946.                          ELSEIF StrCmp(UpperStr(str),'HYBRID2')
  947.                              prr:=9
  948.                          ELSEIF StrCmp(UpperStr(str),'ORDERED')
  949.                              prr:=10
  950.                          ELSEIF StrCmp(UpperStr(str),'ORDERED2')
  951.                              prr:=11
  952.                          ELSEIF StrCmp(UpperStr(str),'FS2')
  953.                              prr:=12
  954.                          ELSEIF StrCmp(UpperStr(str),'FS2FAST')
  955.                              prr:=13
  956.                          ELSEIF StrCmp(UpperStr(str),'FS4')
  957.                              prr:=14
  958.                          ELSEIF StrCmp(UpperStr(str),'MONO')
  959.                              prr:=15
  960.                          ELSEIF StrCmp(UpperStr(str),'RETINA24')
  961.                              prr:=16
  962.                          ELSEIF StrCmp(UpperStr(str),'EGS24')
  963.                              prr:=17
  964.                          ELSEIF StrCmp(UpperStr(str),'VILLAGE24')
  965.                              prr:=18
  966.                          ELSEIF StrCmp(UpperStr(str),'OPAL24')
  967.                              prr:=19
  968.                          ELSEIF StrCmp(UpperStr(str),'OPAL15')
  969.                              prr:=20
  970.                          ELSEIF StrCmp(UpperStr(str),'AMP-COLOR')
  971.                              prr:=21
  972.                          ELSEIF StrCmp(UpperStr(str),'AMP-HAM6')
  973.                              prr:=22
  974.                          ELSEIF StrCmp(UpperStr(str),'AMP-HIRESHAM')
  975.                              prr:=23
  976.                          ELSE
  977.                              EasyRequestArgs(NIL,
  978.                             [SIZEOF easystruct, 0, 'Request Window Name',
  979.                             '   Unknow dither type\nspecified in icon tooltype',
  980.                             'OK I''ll use DEFAULT (gray8)']:easystruct,
  981.                             NIL,NIL)
  982.                          ENDIF
  983.                        ENDIF
  984.                        IF (str:=FindToolType(toolarray,'X_WIN'))>0
  985.                          pri:=Val(str,read)
  986.                           IF read=0
  987.                            x:=pri
  988.                           ENDIF
  989.                        ENDIF
  990.                        IF (str:=FindToolType(toolarray,'Y_WIN'))>0
  991.                          pri:=Val(str,read)
  992.                           IF read=0
  993.                            y:=pri
  994.                           ENDIF
  995.                        ENDIF
  996.                        IF (str:=FindToolType(toolarray,'MP_RAM'))>0
  997.                          IF StrCmp(UpperStr(str),'YES') THEN ch1:=0
  998.                        ENDIF
  999.                        IF (str:=FindToolType(toolarray,'MP_NOP'))>0
  1000.                          IF StrCmp(UpperStr(str),'YES') THEN ch4:=0
  1001.                        ENDIF
  1002.                        IF (str:=FindToolType(toolarray,'MP_NOB'))>0
  1003.                          IF StrCmp(UpperStr(str),'YES') THEN ch3:=0
  1004.                        ENDIF
  1005.                        IF (str:=FindToolType(toolarray,'MP_LOOP'))>0
  1006.                          IF StrCmp(UpperStr(str),'YES') THEN ch2:=0
  1007.                        ENDIF
  1008.                        IF (str:=FindToolType(toolarray,'TOPAZ'))>0
  1009.                          IF StrCmp(UpperStr(str),'YES') THEN font:=0
  1010.                        ENDIF
  1011.               CloseLibrary(iconbase)
  1012.           ENDIF
  1013.    ELSE
  1014.        Raise(NO_ICON)
  1015.    ENDIF
  1016. ENDPROC
  1017.  
  1018. PROC cop(nam1,nam2)
  1019.   DEF buffer,leng,actleng,plik,plik2
  1020.   leng:=10240
  1021.   buffer:= AllocMem(leng,0)
  1022.    IF plik :=Open(nam1,OLDFILE)
  1023.    ELSE
  1024.    ENDIF
  1025.    IF plik2 :=Open(nam2,NEWFILE)
  1026.    ELSE
  1027.    ENDIF
  1028.   REPEAT
  1029.    actleng:=Read(plik,buffer,leng)
  1030.    Write(plik2,buffer,actleng)
  1031.   UNTIL actleng<10240
  1032.   Close(plik)
  1033.   Close(plik2)
  1034. ENDPROC
  1035.  
  1036.